	<!-- Main content -->
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-body table-responsive">
						<?php 
							if (validation_errors()) {
								$html = '<div class="alert alert-danger alert-dismissable">
											<i class="fa fa-warning"></i>' . validation_errors() . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('adicionarok')){
								$html = '<div class="alert alert-success alert-dismissable">
											<i class="fa fa-check"></i>' . $this->session->flashdata('adicionarok') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('cancelarok')){
								$html = '<div class="alert alert-success alert-dismissable">
											<i class="fa fa-check"></i>' . $this->session->flashdata('cancelarok') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('excluirok')){
								$html = '<div class="alert alert-success alert-dismissable">
											<i class="fa fa-check"></i>' . $this->session->flashdata('excluirok') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('detalhePedido')){
								$html = '<div class="alert alert-danger alert-dismissable">
											<i class="fa fa-warning"></i>' . $this->session->flashdata('detalhePedido') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('sucesso')){
								$html = '<div class="alert alert-success alert-dismissable">
											<i class="fa fa-check"></i>' . $this->session->flashdata('sucesso') . '</div>';
								echo $html;
							}
							if ($this->session->flashdata('erro')){
								$html = '<div class="alert alert-danger alert-dismissable">
											<i class="fa fa-warning"></i>' . $this->session->flashdata('erro') . '</div>';
								echo $html;
							}
						?>
						<table id="example1" class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>Pedido</th>
									<th>Cliente</th>
									<th>Data Emissão</th>									
									<th>Total</th>									
									<th>Financeiro</th>
									<th>Comercial</th>
									<th>Status Pedido</th>
								</tr>
							</thead>
							<tbody>
							<?php 
							$pedidos = json_decode($pedidos);
							foreach ($pedidos as $linha) {
							?>
								<tr>
									<td>
										<a href="<?php echo base_url('pedido/detalharPedido/'.$linha->ped_codigo); ?>">
											<?php echo $linha->ped_codigo; ?>
										</a>
									</td>
									<td>
										<?php 
										if (isset($linha->cli_codigo) && $linha->cli_codigo!= null) { 
											echo $linha->cli_codigo->Nome; 
										}
										?>
									</td>
									<td>
										<?php 
										if (isset($linha->ped_emissao) && $linha->ped_emissao != null) {
											echo formataDataHora($linha->ped_emissao);
										}
										?>
									</td>
									<td>
										<?php 
										if (isset($linha->ped_valor_total) && $linha->ped_valor_total != null) {
											echo $linha->ped_valor_total;
										}
										?>
									</td>									
									<td>
										<?php 
										if ($linha->ped_status_financeiro == 0){
											echo '<span class="label label-danger">Pendente</span>';
										} else if ($linha->ped_status_financeiro == 1){
											echo '<span class="label label-success">Aprovado</span>';
										} else if ($linha->ped_status_financeiro == 2){
											echo '<span class="label label-warning">Negado</span>';
										}
										?>
									</td>
									<td>
										<?php 
										if ($linha->ped_status_comercial == 0){
											echo '<span class="label label-danger">Pendente</span>';
										} else if ($linha->ped_status_comercial == 1){
											echo '<span class="label label-success">Aprovado</span>';
										} else if ($linha->ped_status_comercial == 2){
											echo '<span class="label label-warning">Negado</span>';
										}
										?>
									</td>
									<td>
										<?php 
										if ($linha->ped_status == 0){
											echo '<span class="label label-danger">Pendente</span>';
										} else if ($linha->ped_status == 1){
											echo '<span class="label label-success">Enviado</span>';
										} else if ($linha->ped_status == 2){
											echo '<span class="label label-warning">Cancelado</span>';
										}
										?>
									</td>
								</tr>
							<?php } ?>
							</tbody>
							<tfoot>
								<tr>
									<th>Pedido</th>
									<th>Cliente</th>
									<th>Data Emissão</th>									
									<th>Total</th>	
									<th>Financeiro</th>
									<th>Comercial</th>
									<th>Status Pedido</th>
								</tr>
							</tfoot>
						</table>
						<div >
							<a class ="btn btnAdminAlegro"  href="<?php echo base_url('pedido/adicionarCliente');?>">{botaopadrao}</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>